import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

import '@/styles/index.scss' // global css

import BaseHTabs from '@/components/BaseHTabs'
import BaseHScroll from '@/components/BaseHScroll'
import BaseVScroll from '@/components/BaseVScroll'

import App from './App'
import store from './store'
import router from './router'

import '@/icons' // icon
import '@/permission' // permission control

Vue.component('BaseHTabs', BaseHTabs)
Vue.component('BaseHScroll', BaseHScroll)
Vue.component('BaseVScroll', BaseVScroll)
// 字典数据组件
import DictData from '@/components/DictData'
// 字典标签组件
import DictTag from '@/components/DictTag'
DictData.install()
import BaseModal from '@/components/BaseModal'
// 全局组件挂载
Vue.component('DictTag', DictTag)
// 事件总线
// 用于实现不同业务模块之间的消息传递
// this.$bus.$emit('treeCheckOff', false)
// this.$bus.$on('treeCheckOff', this.itemCheckOff)
Vue.prototype.$bus = new Vue()
Vue.prototype.$BaseModal = BaseModal

// if (process.env.NODE_ENV === 'production') {
//   const { mockXHR } = require('../mock')
//   mockXHR()
// }
// 引入echarts.
import * as echarts from 'echarts'

// import echarts from 'echarts'
Vue.prototype.$echarts = echarts

// 如果想要中文版 element-ui，按如下方式声明
Vue.use(ElementUI)

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
